<template>
	<view>
		<view class="header text-xl text-bold margin-top padding" style="text-align: center;">
			{{DAT.XX_BT}}
		</view>
		<view class="action padding">
		   <!-- <rich-text class="text-black test-ellipsis" style="text-indent: 2em;" :nodes="DAT.XX_TXT" /> -->
		   <text space="nbsp">{{DAT.XX_TXT}}</text>
		 </view>
		<view class="imgs" style="display: flex;flex-direction: column;">
			<image v-for="item in imgList" :src="item" mode="widthFix" @tap="previewImage(item)"  style="display: flex;justify-content: center;width: 100%;" ></image>
		</view>
	</view>
</template>

<script  lang="ts" setup>
	import {onLoad} from "@dcloudio/uni-app";
	import {ref} from "vue"
	import {useAnnouncementTitleDetail} from "../Infomange/InfomangeTap/useAnDetali"
	import {usePreview} from "../../utils/usePreview";
	const {previewImage} = usePreview()
	const {initAnnouncementTitleDetail,BASE_URL}:any  = useAnnouncementTitleDetail()
	const DAT = ref<any>({})
	const SchoolImageList = ref<any>([])
	const imgList = ref<any>([])
	onLoad((option:any)=>{
		initAnnouncementTitleDetail(option.XX_ID)
		.then(res=>{
			DAT.value = res.DAT[0]
			if(DAT.value.XX_PIC!=""){
				SchoolImageList.value = DAT.value.XX_PIC.split(";")
				let List = Array()
				for(let i = 0;i<SchoolImageList.value.length;i++){
					List.push(BASE_URL + "/pic_server/browse?picfilename=" +SchoolImageList.value[i])
				}
				imgList.value = List
			}
		})
	})
</script>

<style>
	.header{
		align-items: center;
		size: 20px;
	}
</style>